package com.my.chapter8;

import java.util.Random;

public class practice3 {
    public static void main(String[] args) {
        Shape1 c = new Circle1();
        Shape1 s = new Square1();
        Shape1 t = new Triangle1();
        c.display();
        s.display();
        t.display();
    }
}

class Shape1{
    public void draw(){
        System.out.println("Shape.draw()");
    }
    public void erase(){
        System.out.println("Shape.erase()");
    }
    public void display(){
        System.out.println("Shape");
    }
}

class Circle1 extends Shape1{
    @Override
    public void draw(){
        System.out.println("Circle.draw()");
    }
    @Override
    public void erase(){
        System.out.println("Circle.erase()");
    }
    public void display(){
        System.out.println("Circle");
    }
}

class Square1 extends Shape1{
    @Override
    public void draw(){
        System.out.println("Square.draw()");
    }
    @Override
    public void erase(){
        System.out.println("Square.erase()");
    }
    public void display(){
        System.out.println("Square");
    }
}

class Triangle1 extends Shape1{
    @Override
    public void draw(){
        System.out.println("Triangle.draw()");
    }
    @Override
    public void erase(){
        System.out.println("Triangle.erase()");
    }
    public void display(){
        System.out.println("Triangle");
    }
}


